Time-Optimal Planning For Long-Range Quadrotor Flights: An Automatic Optimal Synthesis Approach